package com.kpx.app.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.kpx.app.R;
import com.kpx.app.base.ActivityBase;
import com.kpx.app.utils.UIUtils;
import com.kpx.app.view.MyWebView;
import com.kpx.app.view.TitleView;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by congdy on 17/3/28.
 * 相关web页面显示
 */

public class ActivityWebShow extends ActivityBase {
    /**
     * 0服务条款
     * 1会员中心
     * 2
     * 3
     */
    public static int type;
    public static String url;
    public static String title;
    @BindView(R.id.titleview)
    TitleView titleview;
    @BindView(R.id.webview)
    MyWebView webview;

    @Override
    public void initview(@Nullable Bundle savedInstanceState) {
        setContentView(R.layout.activity_web_show);
        ButterKnife.bind(this);
        switch (type) {
            case 0:
                UIUtils.setNormalTitle(titleview, "服务条款");
                titleview.setLeft("", new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        finish();
                    }
                }, R.color.black_64, true);
                break;
            case 1:
                UIUtils.setNormalTitle(titleview, "会员中心");
                break;
            case 2:
                UIUtils.setNormalTitle(titleview, title);
                break;
        }
        UIUtils.initWebView(ActivityWebShow.this, webview);
        webview.loadUrl(url);
    }

    @Override
    public void initData() {

    }

    @Override
    public void onReceiver(Context context, Intent intent) {

    }

}
